import { fileURLToPath, URL } from "node:url";
import { resolve } from 'path'
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueDevTools from "vite-plugin-vue-devtools";

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), vueDevTools()],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
      '@layouts': resolve('src/layouts'),
      '@resources': resolve('resources'),
      '@router': resolve('src/router'),
    },
  },
  build: {
    outDir: 'dist', // 输出目录
  },
  server: {
    host: '0.0.0.0',
    port: 3000, // 开发服务器端口
    open: false,  // 自动打开浏览器
  },
});
